The present invention relates to an image processing apparatus and an image processing method, and it can be applied to image processing devices such as a television receiver, a video tape recorder, a television camera or a printer. In the present invention, an area to which an input image data belong is judged, and a judgement result is obtained and a correction coefficient is generated corresponding to the judgement result when pixel values are corrected, with the approach to an edge, the resolution of the judgement result is controlled to increase directly or indirectly; thereby, the gradation can be corrected in avoiding effectively the deterioration of partial contrast. In this case, users shall be careful not to emphasize the outline excessively.
In the conventional image processing apparatus such as a television camera, the gradation of image data obtained through an image input means, for example a photographing means, is corrected within the apparatus and after that the data is output.
FIG. 19 shows characteristic curves showing the input/output characteristics of a signal processing circuit to be applied to a gradation correction processing. A signal processing circuit of this kind decreases the gain when the input level L becomes higher than a predetermined reference level Lk. Thereby, in the case of a signal processing circuit of this kind, when the input level becomes higher than a reference level Lk, the signal level is output being oppressed. In this case, the gradation is corrected at the sacrifice of the contrast in a part where signal level is high.
In the characteristic curve chart shown in FIG. 19, the axis of abscissas expresses the pixel value 1, the input level of the image data, and the axis of ordinates expresses the pixel value T(L), the output level of the image data, and Lmax expresses the maximum level which respective pixels in the input/output image are able to take. Hereinafter, the function showing the input/output relationship as shown in the characteristic curve chart is called a level conversion function.
FIG. 20 shows a characteristic curve chart showing input/output characteristics of the signal processing circuit of the same kind. The signal processing circuit being constituted with the level conversion function decreases the gain when the input level L is lower than the first reference level Ls and when the input level is higher than the second reference level Lb. Thereby, the signal processing circuit corrects gradation at the sacrifice of the contrast in a part where signal level is low and in a part where signal level is high.
On the contrary, in the image processing using a computer, it is arranged to correct gradation by histogram equalization.
The histogram equalization denotes a method in which a level conversion function is appropriately varied corresponding to the frequency distribution of pixel values in the input image data, that is, a method for correcting gradation in decreasing the gradation in a part where the frequency distribution of pixel values is low.
In other words, as shown in FIG. 21, in the processing of the histogram equalization, the cumulative frequency distribution C(L) is detected by the arithmetic processing according to the equation shown below based on the frequency distribution H(L), the total of the number of pixels decided on the basis of the pixel value L in the input image.                               C          ⁡                      (            L            )                          =                              ∑                          k              =              0                        L                    ⁢                      xe2x80x83                    ⁢                      H            ⁡                          (              k              )                                                          (        1        )            
In the histogram equalization processing, the level conversion function T(L) is defined by regularizing the thus detected cumulative frequency distribution C(L) by the processing according to the equation shown below, and the signal level of the input image is corrected according to the level conversion function T(L). In the equation, Fmax denotes the final value of the cumulative frequency distribution C(L), and Lmax denotes the maximum value of the input/output level.                               T          ⁡                      (            L            )                          =                                            C              ⁡                              (                L                )                                                    F              ⁢                              xe2x80x83                            ⁢              max                                xc3x97          L          ⁢                      xe2x80x83                    ⁢          max                                    (        2        )            
The processing for correcting the gradation as mentioned above is executed as occasion demands, in a case where image data is transmitted through a transmission line, in a case where the data is to be displayed in a display device, or in a case where the data is to be stored in a storage device, for example, for the purpose of dynamic range oppression.
In a conventional gradation correction processing as mentioned above, the whole gradation is corrected at the sacrifice of contrast in a part or the other, in any method, it occurs because the level conversion is performed by an input/output function having monotonically increasing characteristics in order to avoid the generation of an unnatural image.
Therefore, in the conventional methods, there has been a problem of partial degradation in contrast in a processed image.
The present invention was invented in consideration of the above mentioned points, and the object of the invention is to offer an image processing device and an image processing method which are able to correct gradation in effectively avoiding the degradation in the partial contrast.
In order to solve the problem as mentioned above, in the image processing device and image processing method according to the present invention, the area to which image data belong is judged and the judgement result is output, and based on the judgement result, the correction coefficient for correcting the pixel values of the image data is generated and output. The pixel values of the image data is corrected according to the correction coefficient. In this case, with the approach to an edge formed by the image data, the resolution of the judgement result is increased.
In the image processing apparatus or the image processing method, an area to which the image data belong is judged and the judgement result is output, and based on the judgement result, the correction coefficient for correcting the pixel values of the image data is generated and output, and the pixel values of the image data is corrected by the correction coefficient. In this case, the correction coefficient is so generated that with the approach to an edge of an image formed by the above-mentioned image data, the resolution of the judgement result corresponding to the correction coefficient is increased.
An area to which the image data belong is judged and the judgement result is output, and based on the judgement result, the correction coefficient for correcting the pixel values of the image data is generated and output. When the pixel values of the image data is corrected according to the correction coefficient in the same area, pixel values are corrected by the same coefficient and the value relationship of pixels is held unchanged, and concerning the pixels existing in the different areas it is also possible even to reverse the value relationship of pixels. Thereby, the gradation as a whole can be corrected in avoiding the degradation in partial contrast.
In this case, by such an arrangement as to increase the resolution of a judgement result with the approach to an edge, and keeping enough correction coefficient in a part being apart from the edge, the change in the correction coefficient with the approach to the edge can be prevented; thereby, it is made possible to prevent an excessive emphasis of an outline.
In place of this, it is also possible to prevent an excessive emphasis of an outline by generating a correction coefficient so that the resolution of the correction coefficient is increased with the approach to an edge.
As mentioned above, according to the present invention, when the pixel values are corrected by generating a correction coefficient based on the judgement result in an area to which the input data belong, the resolution of the judgement result is controlled directly or indirectly to increase with the approach to an edge. Thereby, it is made possible to correct the gradation in effectively avoiding the degradation in partial contrast, which makes it possible to avoid an excessive emphasis of an outline.